﻿using Ldt.DataEngine.DataFlowParse.Model;
using LdtDataEngin.ModuleDetail.CommonModule.XmlCodeCommon;
using LdtJudge.DataEngine.DataBaseStores;
using LdtJudge.DataEngine.Model.Collection;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;

namespace LdtDataEngin.Moudle.CommonModule
{
    public class MoudleOffenceLawExtract : MoudleBase
    {
        private IMoudle _moudle;
        private static string _moudleResult;
        /// <summary>
        /// 违法行为和违法情形模块
        /// </summary>
        /// <param name="moudle">下一个模块</param>
        public MoudleOffenceLawExtract(IMoudle moudle)
        {
            _moudle = moudle;
        }

        public override void MoudleHandle(DataContext dataContext)
        {
            //执行当前模块的相关业务逻辑；
            string moudleName = typeof(MoudleAffordIllegalData).FullName;
            moudleName += "_" + this.GetHashCode();
            // 设置模块进度
            dataContext.InteractiveShow.ModuleProcessShow?.Invoke(moudleName, 0, dataContext.InteractiveShow.inputParameterModel);
            // 创建计时器
            Stopwatch stopwatch = new Stopwatch();
            stopwatch.Start();
            dataContext.InteractiveShow.LogShow("***************************" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "--->法律法规转换违法行为*****************************");
            try
            {
               
            }
            catch (Exception ex)
            {
                dataContext.InteractiveShow.LogShow("违法行为和违法情形错误：" + ex.ToString(), LogMessageType.Error);
            }
            dataContext.InteractiveShow.LogShow("***************************" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "--->法律法规导出违法行为*****************************");
            // 设置模块进度
            stopwatch.Stop();

            dataContext.InteractiveShow.ModuleProcessShow?.Invoke(moudleName + "_" + stopwatch.Elapsed.TotalMilliseconds.ToString("0"), 100, dataContext.InteractiveShow.inputParameterModel);
            //执行完毕调用下一个模块；
            _moudle.MoudleHandle(dataContext);
        }

       
    }
}
